package r2d2.sensors;

import lejos.nxt.I2CPort;
import lejos.nxt.UltrasonicSensor;

public class UltrasonicSensorRd2d2 extends UltrasonicSensor{

	public UltrasonicSensorRd2d2(I2CPort port) {
		super(port);
		
	}
	
	public boolean collide(){
		
		
		int value = this.getDistance();
		if(value== 255)
			return false;
		
		if(value <= 20)
			return true;
		
		return false;
	}

}
